Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RBMap's, iterator-based, remove() #82797

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

RandomShaper
Copy link
Member

RBMap::remove() needs to access private members of its Iterator, but there's no friendship between them, so it's broken.

This PR is here to save the day.


Test code:

	RBMap<int, int> rb_map;
	decltype(rb_map)::Iterator rb_it;
	rb_map.remove(rb_it);

MSVC error:

core/templates/rb_map.h(166): error C2248: 'RBMap<int,int,Comparator<K>,DefaultAllocator>::Iterator::E': cannot access private member declared in class 'RBMap<int,int,Comparator<K>,DefaultAllocator>::Iterator'

@akien-mga akien-mga merged commit 3bc1c9b into godotengine:master Oct 16, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the fix_rbmap branch October 16, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants